package cn.com.freelibra.forum.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import cn.com.freelibra.forum.dao.SectionDetailMapper;
import cn.com.freelibra.forum.po.SectionDetail;
import cn.com.freelibra.forum.service.SectionDetailService;

@Service("sectionDetailService")  
public class SectionDetailServiceImpl implements SectionDetailService{
    @Resource  
    private SectionDetailMapper dao;
    
    @Override
 	public int add(SectionDetail entity) {
 		return dao.insert(entity);
 	}
    
    @Override
	public Page<Map<String, Object>> selectSectionDetailJoinUserList(Long sectionId,Integer pageNumber,Integer pageSize){
    	pageNumber = pageNumber == null?1:pageNumber;
		pageSize = pageSize == null?5:pageSize;
		PageHelper.startPage(pageNumber,pageSize);
		return dao.selectSectionDetailJoinUserList(sectionId);
    }
}
